#!/bin/bash

# make build dir if it doesnt exist:
if [ ! -d "build" ]; then
  mkdir build
fi

# move to build dir:
cd build
# generate make file:
cmake ..
#test if cmake worked: test most recent return value $?
if [ $? -ne 0 ]
then
  echo "CMAKE FAILED"
  exit 1
fi
#cmake worked so make it:
echo "building..."
make
